Integrand size = 23, antiderivative size = 59 \[ \int \frac {a+b \tan (e+f x)}{c+d \tan (e+f x)} \, dx=\frac {(a c+b d) x}{c^2+d^2}-\frac {(b c-a d) \log (c \cos (e+f x)+d \sin (e+f x))}{\left (c^2+d^2\right ) f} \]
Time = 0.12 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.10 \[ \int \frac {a+b \tan (e+f x)}{c+d \tan (e+f x)} \, dx=\frac {2 (a c+b d) \arctan (\tan (e+f x))+(b c-a d) \left (\log \left (\sec ^2(e+f x)\right )-2 \log (c+d \tan (e+f x))\right )}{2 \left (c^2+d^2\right ) f} \]
(2*(a*c + b*d)*ArcTan[Tan[e + f*x]] + (b*c - a*d)*(Log[Sec[e + f*x]^2] - 2 *Log[c + d*Tan[e + f*x]]))/(2*(c^2 + d^2)*f)
Time = 0.33 (sec) , antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {3042, 4014, 3042, 4013}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {a+b \tan (e+f x)}{c+d \tan (e+f x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {a+b \tan (e+f x)}{c+d \tan (e+f x)}dx\) |
\(\Big \downarrow \) 4014 |
\(\displaystyle \frac {x (a c+b d)}{c^2+d^2}-\frac {(b c-a d) \int \frac {d-c \tan (e+f x)}{c+d \tan (e+f x)}dx}{c^2+d^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {x (a c+b d)}{c^2+d^2}-\frac {(b c-a d) \int \frac {d-c \tan (e+f x)}{c+d \tan (e+f x)}dx}{c^2+d^2}\) |
\(\Big \downarrow \) 4013 |
\(\displaystyle \frac {x (a c+b d)}{c^2+d^2}-\frac {(b c-a d) \log (c \cos (e+f x)+d \sin (e+f x))}{f \left (c^2+d^2\right )}\) |
((a*c + b*d)*x)/(c^2 + d^2) - ((b*c - a*d)*Log[c*Cos[e + f*x] + d*Sin[e + f*x]])/((c^2 + d^2)*f)
3.13.12.3.1 Defintions of rubi rules used
Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_) + (b_.)*tan[(e_.) + (f_.)* (x_)]), x_Symbol] :> Simp[(c/(b*f))*Log[RemoveContent[a*Cos[e + f*x] + b*Si n[e + f*x], x]], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && EqQ[a*c + b*d, 0]
Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_.) + (b_.)*tan[(e_.) + (f_. )*(x_)]), x_Symbol] :> Simp[(a*c + b*d)*(x/(a^2 + b^2)), x] + Simp[(b*c - a *d)/(a^2 + b^2) Int[(b - a*Tan[e + f*x])/(a + b*Tan[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && N eQ[a*c + b*d, 0]
Time = 0.22 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.39
method | result | size |
derivativedivides | \(\frac {\frac {\frac {\left (-a d +b c \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (a c +b d \right ) \arctan \left (\tan \left (f x +e \right )\right )}{c^{2}+d^{2}}+\frac {\left (a d -b c \right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{c^{2}+d^{2}}}{f}\) | \(82\) |
default | \(\frac {\frac {\frac {\left (-a d +b c \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (a c +b d \right ) \arctan \left (\tan \left (f x +e \right )\right )}{c^{2}+d^{2}}+\frac {\left (a d -b c \right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{c^{2}+d^{2}}}{f}\) | \(82\) |
norman | \(\frac {\left (a c +b d \right ) x}{c^{2}+d^{2}}+\frac {\left (a d -b c \right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{f \left (c^{2}+d^{2}\right )}-\frac {\left (a d -b c \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f \left (c^{2}+d^{2}\right )}\) | \(85\) |
parallelrisch | \(-\frac {-2 a c f x -2 b d f x +\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) a d -\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) b c -2 \ln \left (c +d \tan \left (f x +e \right )\right ) a d +2 \ln \left (c +d \tan \left (f x +e \right )\right ) b c}{2 f \left (c^{2}+d^{2}\right )}\) | \(87\) |
risch | \(\frac {i x b}{i d -c}-\frac {a x}{i d -c}-\frac {2 i a d x}{c^{2}+d^{2}}+\frac {2 i b c x}{c^{2}+d^{2}}-\frac {2 i a d e}{f \left (c^{2}+d^{2}\right )}+\frac {2 i b c e}{f \left (c^{2}+d^{2}\right )}+\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right ) a d}{f \left (c^{2}+d^{2}\right )}-\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right ) b c}{f \left (c^{2}+d^{2}\right )}\) | \(186\) |
1/f*(1/(c^2+d^2)*(1/2*(-a*d+b*c)*ln(1+tan(f*x+e)^2)+(a*c+b*d)*arctan(tan(f *x+e)))+(a*d-b*c)/(c^2+d^2)*ln(c+d*tan(f*x+e)))
Time = 0.27 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.29 \[ \int \frac {a+b \tan (e+f x)}{c+d \tan (e+f x)} \, dx=\frac {2 \, {\left (a c + b d\right )} f x - {\left (b c - a d\right )} \log \left (\frac {d^{2} \tan \left (f x + e\right )^{2} + 2 \, c d \tan \left (f x + e\right ) + c^{2}}{\tan \left (f x + e\right )^{2} + 1}\right )}{2 \, {\left (c^{2} + d^{2}\right )} f} \]
1/2*(2*(a*c + b*d)*f*x - (b*c - a*d)*log((d^2*tan(f*x + e)^2 + 2*c*d*tan(f *x + e) + c^2)/(tan(f*x + e)^2 + 1)))/((c^2 + d^2)*f)
Result contains complex when optimal does not.
Time = 0.47 (sec) , antiderivative size = 524, normalized size of antiderivative = 8.88 \[ \int \frac {a+b \tan (e+f x)}{c+d \tan (e+f x)} \, dx=\begin {cases} \frac {\tilde {\infty } x \left (a + b \tan {\left (e \right )}\right )}{\tan {\left (e \right )}} & \text {for}\: c = 0 \wedge d = 0 \wedge f = 0 \\\frac {a x + \frac {b \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f}}{c} & \text {for}\: d = 0 \\\frac {i a f x \tan {\left (e + f x \right )}}{2 d f \tan {\left (e + f x \right )} - 2 i d f} + \frac {a f x}{2 d f \tan {\left (e + f x \right )} - 2 i d f} + \frac {i a}{2 d f \tan {\left (e + f x \right )} - 2 i d f} + \frac {b f x \tan {\left (e + f x \right )}}{2 d f \tan {\left (e + f x \right )} - 2 i d f} - \frac {i b f x}{2 d f \tan {\left (e + f x \right )} - 2 i d f} - \frac {b}{2 d f \tan {\left (e + f x \right )} - 2 i d f} & \text {for}\: c = - i d \\- \frac {i a f x \tan {\left (e + f x \right )}}{2 d f \tan {\left (e + f x \right )} + 2 i d f} + \frac {a f x}{2 d f \tan {\left (e + f x \right )} + 2 i d f} - \frac {i a}{2 d f \tan {\left (e + f x \right )} + 2 i d f} + \frac {b f x \tan {\left (e + f x \right )}}{2 d f \tan {\left (e + f x \right )} + 2 i d f} + \frac {i b f x}{2 d f \tan {\left (e + f x \right )} + 2 i d f} - \frac {b}{2 d f \tan {\left (e + f x \right )} + 2 i d f} & \text {for}\: c = i d \\\frac {x \left (a + b \tan {\left (e \right )}\right )}{c + d \tan {\left (e \right )}} & \text {for}\: f = 0 \\\frac {2 a c f x}{2 c^{2} f + 2 d^{2} f} + \frac {2 a d \log {\left (\frac {c}{d} + \tan {\left (e + f x \right )} \right )}}{2 c^{2} f + 2 d^{2} f} - \frac {a d \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 c^{2} f + 2 d^{2} f} - \frac {2 b c \log {\left (\frac {c}{d} + \tan {\left (e + f x \right )} \right )}}{2 c^{2} f + 2 d^{2} f} + \frac {b c \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 c^{2} f + 2 d^{2} f} + \frac {2 b d f x}{2 c^{2} f + 2 d^{2} f} & \text {otherwise} \end {cases} \]
Piecewise((zoo*x*(a + b*tan(e))/tan(e), Eq(c, 0) & Eq(d, 0) & Eq(f, 0)), ( (a*x + b*log(tan(e + f*x)**2 + 1)/(2*f))/c, Eq(d, 0)), (I*a*f*x*tan(e + f* x)/(2*d*f*tan(e + f*x) - 2*I*d*f) + a*f*x/(2*d*f*tan(e + f*x) - 2*I*d*f) + I*a/(2*d*f*tan(e + f*x) - 2*I*d*f) + b*f*x*tan(e + f*x)/(2*d*f*tan(e + f* x) - 2*I*d*f) - I*b*f*x/(2*d*f*tan(e + f*x) - 2*I*d*f) - b/(2*d*f*tan(e + f*x) - 2*I*d*f), Eq(c, -I*d)), (-I*a*f*x*tan(e + f*x)/(2*d*f*tan(e + f*x) + 2*I*d*f) + a*f*x/(2*d*f*tan(e + f*x) + 2*I*d*f) - I*a/(2*d*f*tan(e + f*x ) + 2*I*d*f) + b*f*x*tan(e + f*x)/(2*d*f*tan(e + f*x) + 2*I*d*f) + I*b*f*x /(2*d*f*tan(e + f*x) + 2*I*d*f) - b/(2*d*f*tan(e + f*x) + 2*I*d*f), Eq(c, I*d)), (x*(a + b*tan(e))/(c + d*tan(e)), Eq(f, 0)), (2*a*c*f*x/(2*c**2*f + 2*d**2*f) + 2*a*d*log(c/d + tan(e + f*x))/(2*c**2*f + 2*d**2*f) - a*d*log (tan(e + f*x)**2 + 1)/(2*c**2*f + 2*d**2*f) - 2*b*c*log(c/d + tan(e + f*x) )/(2*c**2*f + 2*d**2*f) + b*c*log(tan(e + f*x)**2 + 1)/(2*c**2*f + 2*d**2* f) + 2*b*d*f*x/(2*c**2*f + 2*d**2*f), True))
Time = 0.35 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.49 \[ \int \frac {a+b \tan (e+f x)}{c+d \tan (e+f x)} \, dx=\frac {\frac {2 \, {\left (a c + b d\right )} {\left (f x + e\right )}}{c^{2} + d^{2}} - \frac {2 \, {\left (b c - a d\right )} \log \left (d \tan \left (f x + e\right ) + c\right )}{c^{2} + d^{2}} + \frac {{\left (b c - a d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{2} + d^{2}}}{2 \, f} \]
1/2*(2*(a*c + b*d)*(f*x + e)/(c^2 + d^2) - 2*(b*c - a*d)*log(d*tan(f*x + e ) + c)/(c^2 + d^2) + (b*c - a*d)*log(tan(f*x + e)^2 + 1)/(c^2 + d^2))/f
Time = 0.34 (sec) , antiderivative size = 94, normalized size of antiderivative = 1.59 \[ \int \frac {a+b \tan (e+f x)}{c+d \tan (e+f x)} \, dx=\frac {\frac {2 \, {\left (a c + b d\right )} {\left (f x + e\right )}}{c^{2} + d^{2}} + \frac {{\left (b c - a d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{2} + d^{2}} - \frac {2 \, {\left (b c d - a d^{2}\right )} \log \left ({\left | d \tan \left (f x + e\right ) + c \right |}\right )}{c^{2} d + d^{3}}}{2 \, f} \]
1/2*(2*(a*c + b*d)*(f*x + e)/(c^2 + d^2) + (b*c - a*d)*log(tan(f*x + e)^2 + 1)/(c^2 + d^2) - 2*(b*c*d - a*d^2)*log(abs(d*tan(f*x + e) + c))/(c^2*d + d^3))/f
Time = 6.15 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.58 \[ \int \frac {a+b \tan (e+f x)}{c+d \tan (e+f x)} \, dx=\frac {\ln \left (c+d\,\mathrm {tan}\left (e+f\,x\right )\right )\,\left (a\,d-b\,c\right )}{f\,\left (c^2+d^2\right )}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (-b+a\,1{}\mathrm {i}\right )}{2\,f\,\left (c+d\,1{}\mathrm {i}\right )}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (a-b\,1{}\mathrm {i}\right )}{2\,f\,\left (d+c\,1{}\mathrm {i}\right )} \]